const Router = require("koa-router")

const router = new Router({ prefix: "/api/topic" })
const controller = require("../controller/topic/topic")

const { auth } = require("../partMiddle/auth")

router.get("/", controller.getTopics)

router.get("/:id", controller.getTopicById)

router.post("/add", auth, controller.addTopic)

router.delete("/:id", auth, controller.delTopicById)

router.patch("/:id", auth, controller.updateTopic)

module.exports = router
